Favicon

You are here: Home > API Reference > Windows > Windows Enrollment Tokens > Create winEnrollmentToken

Create winEnrollmentToken

Create winEnrollmentToken

POST /v1/organizations/:organizationId/mdm/windows/enterprise/enrollment-tokens/

Create winEnrollmentToken

Create winEnrollmentToken

Request

Add parameter in header authorization
Example: Authorization: Bearer <token>
organizationId string
required
Entity Id or Slug
Match pattern: ^(([a-fA-F0-9]{24})|([a-zA-Z0-9\\-]{3,}))$
Body Params application/json
type string optional
object
children object optional
sendEmail object optional
type string optional
boolean
flags object optional
insensitive boolean optional
presence string optional
required
truthy boolean optional
falsy boolean optional
displayName object optional
type string optional
string
valids string optional
rules object optional
name string optional
max
arg number optional
Format: float
128
tags object optional
type string optional
array
flags object optional
sparse boolean optional
items object optional
type string optional
string
valids string optional
rules object optional
name string optional
max
arg number optional
Format: float
128
duration object optional
type string optional
number
flags object optional
unsafe boolean optional
description string optional
Number of seconds between 1m and 30d. 1d by default
invalids number optional
Format: float
null
rules object optional
name string optional
integer
language object optional
type string optional
string
flags object optional
allowOnly boolean optional
valids string optional
es
invalids string optional
emailText object optional
type string optional
string
valids string optional
winPolicyId object optional
type string optional
string
description string optional
Entity Id
valids string optional
rules object optional
name string optional
regex
arg object optional
pattern string optional
Match pattern: ^[a-fA-F0-9]{24}$
winPolicyAssignments object optional
type string optional
array
flags object optional
sparse boolean optional
items object optional
type string optional
object
children object optional
winPolicyId object optional
priority object optional
mdmUserId string required
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
{
    "type": "object",
    "children": {
        "sendEmail": {
            "type": "boolean",
            "flags": {
                "insensitive": true,
                "presence": "required"
            },
            "truthy": true,
            "falsy": true
        },
        "displayName": {
            "type": "string",
            "valids": "",
            "rules": {
                "name": "max",
                "arg": 128
            }
        },
        "tags": {
            "type": "array",
            "flags": {
                "sparse": true
            },
            "items": {
                "type": "string",
                "valids": "",
                "rules": {
                    "name": "max",
                    "arg": 128
                }
            }
        },
        "duration": {
            "type": "number",
            "flags": {
                "unsafe": true
            },
            "description": "Number of seconds between 1m and 30d. 1d by default",
            "invalids": null,
            "rules": {
                "name": "integer"
            }
        },
        "language": {
            "type": "string",
            "flags": {
                "allowOnly": true
            },
            "valids": "es",
            "invalids": ""
        },
        "emailText": {
            "type": "string",
            "valids": ""
        },
        "winPolicyId": {
            "type": "string",
            "description": "Entity Id",
            "valids": "",
            "rules": {
                "name": "regex",
                "arg": {
                    "pattern": "string"
                }
            }
        },
        "winPolicyAssignments": {
            "type": "array",
            "flags": {
                "sparse": true
            },
            "items": {
                "type": "object",
                "children": {
                    "winPolicyId": {
                        "type": "string",
                        "description": "Entity Id",
                        "invalids": "",
                        "rules": {
                            "name": "regex",
                            "arg": {
                                "pattern": "string"
                            }
                        }
                    },
                    "priority": {
                        "type": "number",
                        "flags": {
                            "unsafe": true,
                            "presence": "required"
                        },
                        "invalids": null,
                        "rules": {
                            "name": "integer"
                        }
                    }
                }
            }
        }
    },
    "mdmUserId": "string"
}

Responses

200 Response application/json
status boolean optional
data object optional
id string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
organizationId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
winEnterpriseId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
winDeviceId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
mdmUser object optional
id string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
email string optional
≤ 128 characters
displayName string optional
≤ 128 characters
tags array [string] optional
state string optional
PENDING DONE DELETED EXPIRED
config object optional
type string optional
≤ 128 characters
subType string optional
≤ 128 characters
updatedAt string optional
Format: date-time
createdAt string optional
Format: date-time
expireAt string optional
Format: date-time
enrollmentLink string optional
≤ 500 characters
enrollCode string optional
≤ 128 characters
winPolicyId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
winPolicyAssignments array [object] optional
winPolicyId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
winPolicy object optional
id string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
organizationId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
winEnterpriseId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
name string optional
≤ 256 characters
config object optional
applications array [object] optional
winApplicationId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
configuration object optional
action string optional
≤ 128 characters
forceInstall available
applicationsInfo array [object] optional
scripts array [object] optional
type string optional
once loop onDemand
id string optional
≤ 128 characters
loopTime integer optional
≥ 0
resetDate string optional
Format: date-time
arguments string optional
argumentsProcessed string optional
name string optional
≤ 256 characters
description string optional
≤ 500 characters
runner string optional
≤ 256 characters
scriptsInfo array [object] optional
admxConfigs array [object] optional
winAdmxConfigId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
admxConfigsInfo array [object] optional
id string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
appName string optional
≤ 256 characters
settingType string optional
≤ 256 characters
fileName string optional
≤ 256 characters
description string optional
≤ 256 characters
agentConfiguration object optional
enabled boolean optional
buildTag string optional
≤ 128 characters
allowLocation boolean optional
allowNetworkStatus boolean optional
allowPackageTime boolean optional
allowPackageTransfer boolean optional
assets array [object] optional
mdmAssetId string optional
Entity Id
Match pattern: ^[a-fA-F0-9]{24}$
location string optional
≤ 256 characters
assetName string optional
≤ 256 characters
scope string optional
user system all-users
assetsInfo array [object] optional
version integer optional
≥ 0
updatedAt string optional
Format: date-time
createdAt string optional
Format: date-time
priority integer optional
≥ 0
summary object optional
expirationTimestamp string optional
Format: date-time
sendEmail boolean optional
emailText string optional
{
    "status": true,
    "data": {
        "id": "string",
        "organizationId": "string",
        "winEnterpriseId": "string",
        "winDeviceId": "string",
        "mdmUser": {
            "id": "string",
            "email": "string"
        },
        "displayName": "string",
        "tags": [
            "string"
        ],
        "state": "PENDING",
        "config": {},
        "type": "string",
        "subType": "string",
        "updatedAt": "2024-01-01T00: 00:00Z",
        "createdAt": "2024-01-01T00: 00:00Z",
        "expireAt": "2024-01-01T00: 00:00Z",
        "enrollmentLink": "string",
        "enrollCode": "string",
        "winPolicyId": "string",
        "winPolicyAssignments": [
            {
                "winPolicyId": "string",
                "winPolicy": {
                    "id": "string",
                    "organizationId": "string",
                    "winEnterpriseId": "string",
                    "name": "string",
                    "config": {},
                    "applications": [
                        {
                            "winApplicationId": "string",
                            "configuration": {},
                            "action": "forceInstall"
                        }
                    ],
                    "applicationsInfo": [
                        {}
                    ],
                    "scripts": [
                        {
                            "type": "once",
                            "id": "string",
                            "loopTime": 0,
                            "resetDate": "2024-01-01T00: 00:00Z",
                            "arguments": "string",
                            "argumentsProcessed": "string",
                            "name": "string",
                            "description": "string",
                            "runner": "string"
                        }
                    ],
                    "scriptsInfo": [
                        {}
                    ],
                    "admxConfigs": [
                        {
                            "winAdmxConfigId": "string"
                        }
                    ],
                    "admxConfigsInfo": [
                        {
                            "id": "string",
                            "appName": "string",
                            "settingType": "string",
                            "fileName": "string",
                            "description": "string"
                        }
                    ],
                    "agentConfiguration": {
                        "enabled": true,
                        "buildTag": "string",
                        "allowLocation": true,
                        "allowNetworkStatus": true,
                        "allowPackageTime": true,
                        "allowPackageTransfer": true
                    },
                    "assets": [
                        {
                            "mdmAssetId": "string",
                            "location": "string",
                            "assetName": "string",
                            "scope": "user"
                        }
                    ],
                    "assetsInfo": [
                        {}
                    ],
                    "version": 0,
                    "updatedAt": "2024-01-01T00: 00:00Z",
                    "createdAt": "2024-01-01T00: 00:00Z"
                },
                "priority": 0
            }
        ],
        "summary": {
            "expirationTimestamp": "2024-01-01T00: 00:00Z"
        },
        "sendEmail": true,
        "emailText": "string"
    }
}
400 Response application/json
status boolean optional
false
error object optional
code number optional
5145
message string optional
Error creating winEnrollmentToken
{
    "status": false,
    "error": {
        "code": 5050,
        "message": "Feature not allowed for you billing plan"
    }
}
401 Response application/json
status boolean optional
false
error object optional
code number optional
4004
message string optional
Invalid Token
{
    "status": false,
    "error": {
        "code": 4002,
        "message": "No auth token"
    }
}
404 Response application/json
status boolean optional
false
error object optional
code number optional
3001
message string optional
Entity not found
{
    "status": false,
    "error": {
        "code": 3001,
        "message": "Entity not found"
    }
}